/**
 * Project oo_thread
 */


#include "ProducerThread.h"
#include <iostream>
using std::endl;
using std::cout;
/**
 * ProducerThread implementation
 */


/**
 * @param taskQue
 */
ProducerThread::ProducerThread(TaskQueue& taskQue)
:_taskQue(taskQue)
{

}

/**
 * @return void
 */
void ProducerThread::run() {
     srand(time(nullptr));

        int cnt = 20;
        while(cnt-- > 0) {
            int num = rand() % 100;
            _taskQue.push(num);
            cout << "producer a num :" << num << endl;
            
        }
}
